<?php
/**
Part of The Chad Estioco Framework.

"Executes" an external file (html, javascript, etc.) by echo-ing the
contents of the file to the page.
*/

function executeFile($filename){
	$file = fopen($filename, "r");
	
	if(!$file){
		echo "Error opening " . $filename;
		return;
	}
	
	while(!feof($file)){
		echo fgets($file);
	}
	
	fclose($file);
}

function executeStream($codeArray){
	$i = 0;
	$limit = count($codeArray);
	
	while($i < $limit){
		echo $codeArray[$i];
		$i++;
	}
}

function echo_js($jsfile){
	echo "<script type='text/javascript' language='javascript' src='$jsfile'></script>";
}
?>